#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;

int main()
{
	int n = 20;
	int b = n / 7;
	cout << b << endl;
	return 0;
}

int main() {
    int x = 0;
    cin >> x;
    int n = 1;
    int count = 0;
    while (n <= x)
    {
        int tmp = n;
        while (tmp)
        {
            if (tmp % 7 == 0)
            {
                break;
            }
            int ge = tmp % 10;
            if (ge == 7)
            {
                ++count;
                cout << n << endl;;
                break;
            }
            tmp /= 10;
        }
        ++n;
    }
    int b = x / 7;
    cout << count << " " << b;
    return 0;
}